package com.boat.boat.support.api.controller;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.boat.boat.support.api.dto.account.AccountInfoRsp;
import com.boat.boat.support.api.dto.account.OpenAccountReq;
import com.boat.boat.support.api.dto.account.OpenAccountRsp;
import com.boat.framework.base.api.Response;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * 账户接口
 * 
 * @author 周江
 *
 */
@Tag(name = "账户接口")
@FeignClient(name = "boat-sample-support", contextId = "AccountApi")
public interface AccountApi {
	@Operation(summary = "开通账户")
	@PostMapping("/api/support/account/openAccount")
	Response<OpenAccountRsp> openAccount(@RequestBody OpenAccountReq request);

	@Operation(summary = "查询账户信息")
	@Parameters(value = {
            @Parameter(name = "userId", description = "用户id，从1开始", example = "1")
    })
	@GetMapping("/api/support/account/accountInfo/{userId}")
	Response<AccountInfoRsp> accountInfo(@PathVariable(name = "userId", required = true) Integer userId);
}
